﻿<%@ Page Language="c#" CodeBehind="Listview.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.UnitiveDocument.NewDoc.ListViewPage" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
  <title>Listview</title>
  <script language="javascript" type="text/javascript">
  //<!--
  function selectAll() {
    var inputs = document.body.getElementsByTagName("INPUT");
    for (var i = 0; i < inputs.length; i++) {
      var input = inputs[i];
      if (input.type === "checkbox") {
        input.checked = true;
      }
    }
  }

  function unSelectAll() {
    var inputs = document.body.getElementsByTagName("INPUT");
    for (var i = 0; i < inputs.length; i++) {
      var input = inputs[i];
      if (input.type === "checkbox") {
        input.checked = false;
      }
    }
  }
  //-->
  </script>
  <uds:Style runat="server" Href="~/Css/basiclayout.css" />
</head>
<body>
  <form runat="server">
    <uds:PageTitle runat="server" HintImage="~/DataImages/myDoc2.gif" Title="我的文档">
      <input class="redButtonCss optionbutotn" onclick="selectAll()" type="button" value="全部选择">
      <input type="button" onclick="unSelectAll()" value="全部取消" class="redButtonCss optionbutotn">
      <asp:Button ID="btnThowAwayDocument" runat="server" Text="丢弃文档" CssClass="redButtonCss optionbutotn" />
    </uds:PageTitle>
    <div>
      <table cellspacing="0" cellpadding="0" border="0">
        <tr>
          <td class="selectedTab">已归档</td>
          <td class="unSelectedTab"><a href="../Approve/Listview.aspx" class="Newbutton">待审批</a></td>
        </tr>
      </table>
    </div>
    <uds:UDSDataGrid ID="dgDocList" runat="server" DataKeyField="DocID" OnSortCommand="DataGrid_SortCommand" OnPageIndexChanged="DataGrid_PageChanged">
      <Columns>
        <asp:TemplateColumn HeaderText="◎">
          <HeaderStyle Width="5%" />
          <ItemTemplate>
            <asp:CheckBox ID="DocID" runat="server" />
          </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn SortExpression="DocTitle" HeaderText="文档标题">
          <HeaderStyle HorizontalAlign="Left" Width="25%"></HeaderStyle>
          <ItemStyle Font-Size="X-Small" HorizontalAlign="Left"></ItemStyle>
          <ItemTemplate>
            <a href='../Document/BrowseDocument.aspx?DocId=<%# DataBinder.Eval(Container.DataItem,"DocID") %>'><%# (DataBinder.Eval(Container.DataItem,"DocTitle").ToString().Length>30)?DataBinder.Eval(Container.DataItem,"DocTitle").ToString().Substring(0,30)+"...":DataBinder.Eval(Container.DataItem,"DocTitle").ToString() %> </a>
          </ItemTemplate>
        </asp:TemplateColumn>
        <asp:BoundColumn DataField="DocViewedTimes" SortExpression="DocViewedTimes" HeaderText="浏览次数">
          <HeaderStyle Width="10%"></HeaderStyle>
          <ItemStyle Font-Size="X-Small" HorizontalAlign="Center"></ItemStyle>
        </asp:BoundColumn>
        <asp:TemplateColumn SortExpression="DocApprover" HeaderText="审批人">
          <HeaderStyle Width="10%"></HeaderStyle>
          <ItemTemplate>
            <asp:Label runat="server" Text='<%# GetRealName(DataBinder.Eval(Container, "DataItem.DocApprover").ToString()) %>'>
            </asp:Label>
          </ItemTemplate>
        </asp:TemplateColumn>
        <asp:TemplateColumn SortExpression="DocAddedBy" HeaderText="上传人">
          <HeaderStyle Width="10%"></HeaderStyle>
          <ItemTemplate>
            <asp:Label runat="server" Text='<%# GetRealName(DataBinder.Eval(Container, "DataItem.DocAddedBy").ToString()) %>'>
            </asp:Label>
          </ItemTemplate>
        </asp:TemplateColumn>
        <asp:HyperLinkColumn DataNavigateUrlField="ClassID" DataNavigateUrlFormatString="../Project.aspx?ClassID={0}" DataTextField="ClassName" SortExpression="ClassName" HeaderText="所属项目">
          <HeaderStyle Width="20%"></HeaderStyle>
          <ItemStyle Font-Size="Smaller" HorizontalAlign="Center"></ItemStyle>
        </asp:HyperLinkColumn>
        <asp:TemplateColumn SortExpression="DocAddedDate" HeaderText="上传日期">
          <HeaderStyle HorizontalAlign="Center" Width="20%"></HeaderStyle>
          <ItemStyle Font-Size="X-Small" HorizontalAlign="Center"></ItemStyle>
          <ItemTemplate>
            <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.DocAddedDate") %>'>
            </asp:Label>
          </ItemTemplate>
        </asp:TemplateColumn>
      </Columns>
    </uds:UDSDataGrid>
  </form>
</body>
</html>
